package com.astrocsr.domain.model;

import java.io.Serializable;

import com.astrocsr.domain.db.PagingInfo;

@SuppressWarnings("serial")
public abstract class BaseModel implements Serializable {
	
	private String message="";
	private String successMessage="";
	private String errorMessage = "";
	private String failMessage="";

	// paging
	private PagingInfo pagingInfo;
	private int page;	// Page Index
	private int rows;	// Number of rows per page
	
	public String getSuccessMessage() {
		return successMessage;
	}

	public void setSuccessMessage(String successMessage) {
		this.successMessage = successMessage;
	}

	public String getFailMessage() {
		return failMessage;
	}

	public void setFailMessage(String failMessage) {
		this.failMessage = failMessage;
	}

	public String getErrorMessage() {
		return errorMessage;
	}

	public void setErrorMessage(String errorMessage) {
		this.errorMessage = errorMessage;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public PagingInfo getPagingInfo() {
		if (pagingInfo == null) {
			pagingInfo = new PagingInfo(rows, page);
		}
		return pagingInfo;
	}

	public void setPagingInfo(PagingInfo pagingInfo) {
		this.pagingInfo = pagingInfo;
	}

	public int getPage() {
		return page;
	}

	public void setPage(int page) {
		this.page = page;
	}

	public int getRows() {
		return rows;
	}

	public void setRows(int rows) {
		this.rows = rows;
	}
   
}
